<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/3/6
 * Time: 16:34
 */

namespace app\admin\controller;
use think\Config;
use think\Controller;
use think\Db;
use think\Request;
use Common\Oss;
use think\Session;

class Common extends controller
{

    public function _initialize()
    {
        $user_info = Session::get('user_info');
        if(empty($user_info))
        {
            $flag = Db::name('system_setting')->where('id',2)->value('value');
            Session::set('flag' , $flag);
            if(Request::instance()->action() != 'login')
            {
                $this->redirect('Index/login');exit;
            }
        }
    }

}